package com.zhuzhe.blog.oauth2.config;

import com.zhuzhe.blog.oauth2.mobile.SmsSend;
import com.zhuzhe.blog.oauth2.mobile.SmsSendImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description 为容器添加bean实例
 * @author: u53
 * @create: 2020-10-22 09:17
 **/
@Configuration
public class SecurityConfigBean {

    /**
     * 默认采用SmsSendImpl实例
     * 如果容器中添加SmsSend类型得示例
     * 那么该实例就失效了
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(SmsSend.class)
    public SmsSend smsSend(){
        return new SmsSendImpl();
    }


}
